﻿#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using MilwormsGameData;
#endregion

namespace MilwormsGameContentPipeline
{
    [ContentTypeWriter]
    public class AnimationWriter : MilwormsGameWriter<Animation>
    {
        protected override void Write(ContentWriter output, Animation value)
        {
            output.Write(String.IsNullOrEmpty(value.Name) ? String.Empty : value.Name);
            output.Write(value.StartingFrame);
            output.Write(value.EndingFrame);
            output.Write(value.Interval);
            output.Write(value.IsLoop);
        }

        public override string GetRuntimeType(TargetPlatform targetPlatform)
        {
            return typeof(MilwormsGameData.Animation).AssemblyQualifiedName;
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return typeof(MilwormsGameData.Animation.AnimationReader).AssemblyQualifiedName;
        }
    }
}
